<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-GB" dir="ltr" class="client-js" xml:lang="en-GB">
  <head>
    <title>ToDo List</title>
</head>
<body>
<h2>ToDo List for HtmlToEpub Chrome App</h2>
<h3>Steps to create EPUB Phase one (no image file support)</h3>
<ul>
<li>Specify working directory and URL to download</li>
<li>Fetch initial file from web.  Investigate WebView.</li>
<li><strike>Parse file for content (chapter) URLs</strike></li>
<li><strike>Fetch the chapter HTML documents</strike></li>
<li><strike>Extract wanted text from documents and repackage. Strip javascript, comments, stylesheets</strike></li>
<li><strike>Phase 1, strip &lt;img&gt; tags</strike></li>
<li><strike>Generate content.opf</strike></li>
<li><strike>Generate Nested ToC</strike></li>
<li><strike>Add correct author to content.opf</strike></li>
<li><strike>Fixup footnotes</strike></li>
<li><strike>Pack epub</strike></li>
</ul>

<h3>Steps to create EPUB Phase two (image support)</h3>
<ul>
<li><strike>May want to split content</strike></li>
<li><strike>Locate images.  Download images and update &lt;img&gt; tags</strike></li>
<li>Adjust UI dynamically, depending on web page being viewed</li>
<li><strike>Move fetching additional content files (XHTML or image) into parser class.</strike></li>
<li><strike>Add images to content.opf and the zip</strike></li>
<li>Rework gallery and inline image tags in HTML files</li>
<li>Fixup any text that appears before or after the gallery image table.</li>
<li><strike>Add cover (does it make sense to add cover to content and ToC, then delelete if not present?</strike></li>
<li>Handle Gallery image different to inline?</li>
<li><strike>Add Style (for images) to XHTML header</strike></li>
</ul>

<h3>Side Tasks</h3>
<ul>
<li>Get code inspected</li>
<li>Check all // ToDo comments have been done.</li>
<li>Figure out cleanest way to add cover + fixup content.opf for cover</li>
<li>Get a better icon</li>
<li>When fix footnotes, Hyperlink can be hash only.</li>
<li>Replace Developer Stuff buttons "Pack Raw Chapters" and "Fetch Chapters" with single "Fetch and Save Raw".</li>
<li>Improve HTML to XHTML conversion and packaging to ePUB.
<ul>
<li>Detect and fix up hypterlinks to same page.</li>
<li>Remove any id attributes that are no longer needed</li>
</ul></li>
<li>fate:zero chapter 3, generates a lot of epubcheck warnings. Looks like it may have different formatting for translator notes.</li>
</ul>

<h3>Immediate Tasks</h3>
<ul>
<li>Check if still need to append "?view_adult=true" to URLs.</li>
<li>Check cookies associated with XMLHttpRequest</li>
<li>Investigate onmouseout event for saving settings</li>
</ul>

<h3>Finished Tasks</h3>
<ul>
<li><strike>Figure out how to load file resources synchronously for unit testing</strike></li>
<li><strike>Convert into Chrome extension.  Need to look into how to do fetch.</strike></li>
<li><strike>Remove the images part of UI for time being</strike></li>
<li><strike>Parse title and author out of document</strike></li>
<li><strike>Add language to epub properties</strike></li>
<li><strike>Download process: Give error message on failure</strike></li>
<li><strike>Update progress downloading chapters</strike></li>
<li><strike>Check if Zip/Download can handle files > 10 Mbyte</strike></li>
<li><strike>For Fetch, read URL from web page.</strike></li>
<li><strike>Parse title and author out of document</strike></li>
<li><strike>How to correctly add XML comment to start of X(HT)ML files.</strike></li>
<li><strike>Create Icon.</strike></li>
<li><strike>Extract just the bits I need out of FileSaver.js.</strike></li>
<li><strike>Get Icon</strike></li>
<li><strike>Document Licenses</strike></li>
<li><strike>Add a git link to github?</strike></li>
<li><strike>Move "Fetch Chapters" and "Fetch Images" buttons to diagnostics.  Fetch chapters/images as part of clicking "Pack EPUB"</strike></li>
<li><strike>What to do for Baka-Tsuki with no images?  e.g. https://www.baka-tsuki.org/project/index.php?title=Anohana:Part_1</strike></li>
<li><strike>Cover image needs to be packaged as SVG image element</strike></li>
<li><strike>Baka-Tsuki, needs to check for &lt;img&gt; elements that were not processed.  See: https://www.baka-tsuki.org/project/index.php?title=Gekkou </strike></li>
<li><strike>Rework ParserFactory class, to be Map based.  (May make testing easier?)</strike></li>
<li><strike>Get BakaTsukiEpubItemSupplier ctor to call EpubItemSupplier ctor?</strike></li>
<li></strike>Unify EpubItemSupplier (which uses chapters) and BakaTsukiItemSupplier (which uses EpubItem). Get EpubItemSupplier to use EpubItem.  Also EpubItem/BaskTsukiEpubItem</strike></li>
<li><strike>Update instructions</strike></li>
<li><strike>Rework Parser.fetchChapters() should really load the images associated with each page after relevant page, rather than all at the end. Although this leaves question of when to fetch cover image, if one is wanted.</strike></li>
<li><strike>Strip iframe elements</strike></li>
<li><strike>Replace &lt;center&gt; tags, they're not legal XHTML.</strike></li>
<li><strike>EpubPacker.save() needs to get rid of object created by createObjectURL() when we're done with it.</strike></li>
<li><strike></strike></li>
<li><strike></strike></li>
</ul>

<h3>Links</h3>
<ul>
<li>XMLHttpRequest
<ul>
<li>https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest</li>
<li>https://developer.mozilla.org/en-US/docs/HTML_in_XMLHttpRequest</li>
<li>https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest/Sending_and_Receiving_Binary_Data</li>
<li>https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Monitoring_progress</li>
</ul>
<li>FileSystem
<ul>
<li>https://developer.chrome.com/apps/fileSystem</li>
<li>https://github.com/GoogleChrome/chrome-app-samples/tree/master/samples/filesystem-access</li>
<li>https://developer.mozilla.org/en-US/docs/Web/API/FileEntry</li>
<li>http://www.html5rocks.com/en/tutorials/file/filesystem/</li>
<li></li>
</ul>
<li>Javascript Zip library
<ul>
<li>https://stuk.github.io/jszip/</li>
</ul>
<li>Saving file to downloads
<ul>
<li>https://github.com/eligrey/FileSaver.js/</li>
</ul>
</ul>

<h3>Notes</h3>
<ul>
<li>https://github.com/GoogleChrome/chrome-app-samples/tree/master/samples/messaging</li>
<li>First chapter may have some text before the opening title.</li>
<li>Not all images appear in the text.</li>
<li>Image tag not being closed because HtmlNode._ownerdocument not set for inner nodes.</li>
<li>For our purposes, EPUB only has two file types, XHTML files, and image files
<ul>
    <li>The HTML files are in reading order (i.e. Appear in same order as spine, and table of contents)</li>
    <li>First image, (if there are any) will be the cover image</li>
</ul>
<li>use --allow-file-access-from-files for unit testing in Chrome, note, close all instances of Chrome before running with this flag.</li>
</li>
</ul>

<h3>Question</h3>
<ul>
<li>How to validate image tags?</li>
</ul>

</body></html>